package obj;

import UI.control;

import java.util.Random;

public class create implements Runnable{
    private All obj;
    private Random r;
    public create(All a){
        this.obj=a;
        r=new Random();
    }
    @Override
    public void run(){
        while(true){
            while(obj.flys.size()<7) {
                obj.AddPlayer(new player(r.nextInt(0, (int) control.heigth - 100), r.nextInt(0, (int) control.width / 2), 5, 1));
                try {
                    Thread.sleep(2000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        }
    }
}
